package paws.launch;

import paws.core.*; 
import scala.collection.*; 
import java.lang.Iterable;

public class JavaTest {
  public static void main(String[] args) {
    Simulation s = new Simulation();
    NodeParameters np = new NodeParameters();
    
    for(int i = 0; i < 10; i++)
      s.addNode(new Node(i, s, np));    
    s.start();    
    
    Iterable<Node> ns = JavaConversions.asIterable(s.getNodes());    
    for(Node n: ns) 
      n.send("speak");
    
    s.send("exit");
  }
  
  public static void sleep(int t) {
    try {
      Thread.sleep(t);
    } catch (Exception e) {
      e.printStackTrace();
    }
    System.out.println("Sleep over.");
  }
}
